home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F38358_testSomeTrue.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  1.3 KB  |  47 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  2.   <xsl:import href="allTrue.xsl"/>
  3.   <xsl:import href="someTrue.xsl"/>
  4.   
  5.   <xsl:output omit-xml-declaration="yes"/>
  6.   
  7.    <!-- This transformation must be applied to:
  8.         boolNodes.xml 
  9.      -->
  10.  
  11.   <xsl:template match="/">
  12.     <xsl:variable name="allTrue">
  13.         <xsl:call-template name="allTrue">
  14.           <xsl:with-param name="pList" select="/*/*"/>
  15.         </xsl:call-template>
  16.     </xsl:variable>
  17.     
  18.     <xsl:if test="not(string($allTrue))">
  19.       <xsl:text>Not </xsl:text>
  20.     </xsl:if>
  21.     <xsl:value-of select="'all nodes contents are true in:'"/>
  22.     <xsl:text> </xsl:text>
  23.     <xsl:copy-of select="/*/*"/>
  24.  
  25.     <xsl:text> </xsl:text>
  26.        
  27.     <xsl:variable name="someTrue">
  28.         <xsl:call-template name="someTrue">
  29.           <xsl:with-param name="pList" select="/*/*"/>
  30.         </xsl:call-template>
  31.     </xsl:variable>
  32.     
  33.     <xsl:choose>
  34.         <xsl:when test="not(string($someTrue))">
  35.           <xsl:text>None are true</xsl:text>
  36.         </xsl:when>
  37.         <xsl:otherwise>
  38.           <xsl:text>Some are true</xsl:text>
  39.         </xsl:otherwise>
  40.     </xsl:choose>
  41.     
  42.     <xsl:text> </xsl:text>
  43.     <xsl:copy-of select="/*/*"/>
  44.      
  45.   </xsl:template>
  46. </xsl:stylesheet>
  47.